/**
 * DatasourceTableModel.java
 * 2012-3-12 下午11:37:36
 */
package xgenerator.ui.swing.model;

import javax.swing.table.DefaultTableModel;

/**
 * <p>
 * Title：数据源表模型
 * </p>
 * <p>
 * Description:具体功能见各方法描述
 * </p>
 * <p>
 * Copyright:Copyright (c) 2012
 * </p>
 * 
 * @author <a href="mailto:lishushan@gmail.com">liss</a>
 * @version 1.0
 */
public class DatasourceTableModel extends DefaultTableModel {

	/**
	 * Serializable
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * 数据源名称列索引=0
	 */
	public static final int DS_NAME_INDEX = 0;
	
	/**
	 * jdbc驱动类名列索引=2
	 */
	public static final int DRIVER_CLASS_NAME_INDEX = 1;
	
	/**
	 * URL列索引=3
	 */
	public static final int URL_INDEX = 2;
	
	/**
	 * 用户名列索引=4
	 */
	public static final int USER_NAME_INDEX = 3;
	
	/**
	 * 密码列索引=5
	 */
	public static final int PASSWORD_INDEX = 4;
	
	/**
	 * 表列头
	 */
	public static final Object[] COLUMN_NAMES = {"数据源名称", "驱动类名", "URL", "用户名", "密码"};

	/**
	 * 列数据类型
	 */
	public static final Class[] COLUMN_CLASS = {String.class, String.class, String.class, String.class, String.class};
	
	
	@Override
	public Class getColumnClass(int columnIndex) {
		return COLUMN_CLASS[columnIndex];
	}
}
